import Vue from 'vue'
import Router from 'vue-router'
import Login from '../components/login'
import Register from '../components/register'
import Contacts from '../components/notes'
import AddressList from '../components/addressList'
import AddCon from '../components/addCon'
import Own from '../components/own'
import Home from '../components/home'

Vue.use(Router)

export default new Router({
	mode:"history",
	routes: [
	    {
	    	path: '/', 
	    	redirect: '/home/register'
	    },

	    {
	      path: '/home',
	      component: Home,
	      children: [
	        {path: 'login', component: Login},
	        {path: 'register', component: Register},
	      ]
	    },

		{
			path: '/address',
			component: AddressList,
			children:[
				{path:'',component:Contacts,meta: {logined: true}},
				{path:'addcon',component:AddCon},
				{path:'own',component:Own}
			]
		}
	]
})
